<table class="common-table">
	<thead>
		<tr>
			<th>ID</th>
			<th>账号</th>
			<th>真名</th>
			<th>会员级别</th>
			<th>状态</th>
			<th>身份验证</th>
			<th>修改时间</th>
			<th>修改者</th>
			<th>身份验证</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		#{if users}
			#{list items:users, as:'user'}
			<tr>
				<th><a href="/admin/users/${user.id};edit">${user.id}</a></th>
				<td><a href="/admin/users/${user.id};edit">${user.username}</a></td>
				<td>${user.realname}</td>
				<td><a href="/admin/users/${user.id};editGroup">${user.group?.name}</a></td>
				<td>
					#{if user.status == models.BaseEntity.Status.ENABLE}
					<font class="important_2">可用</font>
					#{/if}
					#{if user.status == models.BaseEntity.Status.DISABLED}
					<font class="important_1">不可用</font>
					#{/if}
				</td>
				<td>
					#{if user.authentication}<font class="important_2">通过</font>#{/if}
					#{if user.authentication == false}未验证#{/if}
				</td>
				<td>${user.lastModifiedAt?.format('yyyy-MM-dd hh:mm')}</td>
				<td>
					#{if user.modifierType == models.BaseEntity.PeopleType.ADMIN}
						${user.lastModifiedByAdmin?.username}
					#{/if}
					#{if user.modifierType == models.BaseEntity.PeopleType.USER}
						${user.lastModifiedByUser?.username}
					#{/if}
				</td>
				<td>
					#{if user.authentication}
					<a href="javascript:updateAuthentication(${user.id},'false')" class="important_1">
					[不通过]
					</a>
					#{/if}
					#{if user.authentication == false}
					<a href="javascript:updateAuthentication(${user.id},'true')" class="important_2">
					[通过]
					</a>
					#{/if}
				</td>
				<td>
					#{if user.status == models.BaseEntity.Status.ENABLE}
					<a href="javascript:updateBrandStatus(${user.id}, 'DISABLED')" class="important_1">
					[禁用]
					</a>
					#{/if}
					#{if user.status == models.BaseEntity.Status.DISABLED}
					<a href="javascript:updateBrandStatus(${user.id}, 'ENABLE')" class="important_2">
					[启用]
					</a>
					#{/if}
				</td>
				<td>
					<a href="/admin/users/${user.id};edit" class="editer">
					[修改]
					</a>
				</td>
			</tr>
			#{/list}
		#{/if}
		#{else}
		<tr>
			<td colspan="7">没找到结果。</td>
		</tr>
		#{/else}
	</tbody>
</table>
<div id="pager" style="font-size:1.3em;"></div>
<script language="javascript">
//初始化翻页控件。
function initialPager() {
	$("#pager").pager(
		{
			pagenumber: ${queryBean.currentPage}, 
			pagecount: ${queryBean.totalPage}, 
			totalcount: ${queryBean.totalQuantity},
			buttonClickCallback: PageClick
		}
	);
}
//翻页功能。
function PageClick(pageclickednumber) {
	$("#currentPage").val(pageclickednumber);
	reloadTable();
}
</script>